package main

import (
	"fmt"
	_"github.com/go-sql-driver/mysql"
	"github.com/jmoiron/sqlx"
)

func main() {
	DB, err := sqlx.Open("mysql", "root:@tcp(127.0.0.1:3306)/test")
	if err != nil {
		fmt.Println("Open mysql failed")
	}
	err = DB.Ping()
	if err != nil {
		fmt.Println("Ping mysql failed")
	} else {
		fmt.Println("MySQL client success")
	}

}